<?php


namespace App\Models\Workflow;

use App\Models\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class WorkflowProcess extends Model
{
    protected $table = 'akbus_workflow_process';

    protected $fillable = [
        'apply_key',
        'apply_id',
        'node_id',
        'status',
        'result_name',
        'reason',
    ];

    /**
     * 不可批量赋值的属性。
     *
     * @var array
     */
    protected $guarded = [
    ];

    /**
     * 类型转化
     *
     * @var array
     */
    protected $casts = [
    ];

    /**
     * 隐藏的字段
     *
     * @var array
     */
    protected $hidden = [
    ];

    /**
     * 对应的申请
     *
     * @return BelongsTo
     */
    public function node(): BelongsTo
    {
        return $this->belongsTo(WorkflowNode::class);
    }
}
